////////////////////////////////////////////////////////////////////////////////////////
//	Name:	SineTable Library
//	Author:	Raul James raul.james49@gmail.com)
//	Date:	June 25, 2011
//	Descr:	Handles the processing of sinetables
////////////////////////////////////////////////////////////////////////////////////////

#define TABLELEN (TABLEDEPTH*4)
#define OFFSET (TABLELEN/3);

#include "sinetablegenerator.h"

unsigned short int sineValues[TABLELEN];//[3];							// allocate memory for sinetable

unsigned short int sinetableInit(){
	if(!generateTable(&sineValues[0], TABLELEN)){															// populate sinetable
		return(0);																														// terminate program on error
	}
}


//void	getDutyCycles(unsigned short int *ptrArray, int pos){
//	//Precondition: pos<=TABLELEN-1
//
//	unsigned short int *ptrCurrent,;//y,z;
////	ptrCurrent = ptrTable + pos*3;
// ptrCurrent = &sineValues[0];
//
//   y = pos+OFFSET;
//   y = (y >=TABLELEN)  ?(y-TABLELEN)   :y ;    //Range y: 0 -> (TABLELEN-1)
//   z = y+OFFSET;
//   z = (z >= TABLELEN) ?(z-TABLELEN)   :z ;    //Range z: 0 -> (TABLELEN-1)
//
//	*(ptrArray) = *(ptrCurrent+pos);
//	*(ptrArray+1) = *(ptrCurrent+y);
//	*(ptrArray+2) = *(ptrCurrent+z);
//}

